﻿namespace OpenLS.Spreadsheet.UI.Internals
{
    class ProtectionFormatter: FormatterBase
    {
        private bool _isHidden;
        private bool _isLocked;

        public ProtectionFormatter(FormattingRecord record)
        {
            this._isLocked = record.IsLocked;
            this._isHidden = record.IsHidden;
        }

        public bool IsLocked
        {
            get { return _isLocked; }
            set
            {
                _isLocked = value;
                SetDirty();
            }

        }
        public bool IsHidden
        {
            get { return _isHidden; }
            set
            {
                _isHidden = value;
                SetDirty();
            }
        }

        protected override void ApplyOverride(Range selection)
        {
            selection.IsLocked = this.IsLocked;
            selection.IsHidden = this.IsHidden;
        }
    }
}